package com.io.io02;

import java.io.FileInputStream;
import java.io.InputStream;

public class Demo4 {
    public static void main(String[] args) throws Exception {
        InputStream is = new FileInputStream("./hello.txt");
        while (true) {
            int data = is.read();
            if (data == -1) {
                // 所有数据都被读完了
                break;
            }

            // 否则，data 就是我们取到的数据
            byte b = (byte) data;
            System.out.printf("%02x\n", b);
        }
        is.close();
    }
}
